Generalized Algebraic Data Type Exploration
نویسندگان
چکیده
1
منابع مشابه
Typing ZINC Machine with Generalized Algebraic Data Types
The Krivine-style evaluation mechanism is well-known in the implementation of higher-order functions, allowing to avoid some useless closure building. There have been a few type systems that can verify the safety of the mechanism. The incorporation of the proposed ideas into an existing compiler, however, would require significant changes in the type system of the compiler due to the use of som...
متن کاملInvestigation of GADT applications and usage
Generalized Algebraic Datatypes, or GADTs, extend algebraic datatypes by allowing an explicit relation between type parameters and constructor definitions. They can be used in numerous applications like modeling programming languages, maintaining invariants in data structures and in implementing constraints in domain-specific languages. In our project, we discuss GADTS and provide some of their...
متن کاملTowards Efficient, Typed LR Parsers
The LR parser generators that are bundled with many functional programming language implementations produce code that is untyped, needlessly inefficient, or both. We show that, using generalized algebraic data types, it is possible to produce parsers that are well-typed (so they cannot unexpectedly crash or fail) and nevertheless efficient. This is a pleasing result as well as an illustration o...
متن کاملObjects to Unify Type Classes and GADTs
We propose an Haskell-like language with the goal of unifying type classes and generalized algebraic datatypes (GADTs) into a single class construct. We treat classes as first-class types and we use objects (instead of type class instances and data constructors) to define the values of those classes. We recover the ability to define functions by pattern matching by using sealed classes. The res...
متن کاملAmbivalent Types for Principal Type Inference with GADTs
GADTs, short for Generalized Algebraic DataTypes, which allow constructors of algebraic datatypes to be non-surjective, have many useful applications. However, pattern matching on GADTs introduces local type equality assumptions, which are a source of ambiguities that may destroy principal types— and must be resolved by type annotations. We introduce ambivalent types to tighten the definition o...
متن کامل